package org.groupg.practice.guiPractice.tools;

import java.awt.Dimension;
import java.awt.Toolkit;

public class GetDesktopSize {
    public static void main(String[] args) {
        // 获取默认的 Toolkit 实例
        Toolkit toolkit = Toolkit.getDefaultToolkit();

        // 获取当前屏幕的尺寸
        Dimension screenSize = toolkit.getScreenSize();

        // 获取屏幕的宽度和高度
        int screenWidth = screenSize.width;
        int screenHeight = screenSize.height;

        // 输出屏幕的宽度和高度
        System.out.println("Screen Width: " + screenWidth);
        System.out.println("Screen Height: " + screenHeight);
    }
}